package com.ruoyi.system.outto.game.impl;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.exception.GlobalException;
import com.ruoyi.common.utils.AESUtil;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.UUIDGenerator;
import com.ruoyi.system.mapper.SysDictDataMapper;
import com.ruoyi.system.model.domain.AccountInfo;
import com.ruoyi.system.model.domain.InfoImg;
import com.ruoyi.system.model.domain.Jymtask;
import com.ruoyi.system.model.domain.SalePartner;
import com.ruoyi.system.model.mapper.AccountInfoMapper;
import com.ruoyi.system.model.mapper.InfoImgMapper;
import com.ruoyi.system.V2.inter.mapper.JymtaskMapper;
import com.ruoyi.system.outto.JYMEmun;
import com.ruoyi.system.outto.core.JYMRegionalCovert;
import com.ruoyi.system.outto.core.LCConstant;
import com.ruoyi.system.outto.core.OutUrlConstant;
import com.ruoyi.system.outto.core.constant.GameTypeConstant;
import com.ruoyi.system.outto.game.CommonApi;
import com.ruoyi.system.outto.game.IJYMAPI;
import com.taobao.api.ApiException;
import com.taobao.api.DefaultTaobaoClient;
import com.taobao.api.TaobaoClient;
import com.taobao.api.request.AlibabaJymItemExternalGoodsBatchModifypriceRequest;
import com.taobao.api.request.AlibabaJymItemExternalGoodsBatchOffsaleRequest;
import com.taobao.api.request.AlibabaJymItemExternalGoodsBatchPublishRequest;
import com.taobao.api.request.AlibabaJymItemExternalGoodsBatchtaskQueryRequest;
import com.taobao.api.response.AlibabaJymItemExternalGoodsBatchModifypriceResponse;
import com.taobao.api.response.AlibabaJymItemExternalGoodsBatchOffsaleResponse;
import com.taobao.api.response.AlibabaJymItemExternalGoodsBatchPublishResponse;
import com.taobao.api.response.AlibabaJymItemExternalGoodsBatchtaskQueryResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
import java.util.regex.Pattern;

@Slf4j
@Service
public class JYMAPIImpl implements IJYMAPI {
    @Resource
    private InfoImgMapper infoImgMapper;
    @Resource
    private AccountInfoMapper accountInfoMapper;
    @Value("${desc.title}")
    private String descTitle;
    @Value("${desc.aesKey}")
    private String aesKey;

    @Resource
    private JymtaskMapper jymtaskMapper;

    @Resource
    private SysDictDataMapper sysDictDataMapper;
    @Resource
    private CommonApi commonApi;

    @Override
    public AjaxResult addGame(AccountInfo accountInfo, Long userId, SalePartner salePartner) {

        String des = accountInfo.getDes();
        String guolv = guolv(des);
        accountInfo.setDes(guolv);

        Map<String, Object> params = params(accountInfo, "add", salePartner);
        return AjaxResult.success(params);
    }

    @Override
    public AjaxResult editGame(AccountInfo accountInfo, Long userId, SalePartner sa) {

        BigDecimal bigDecimal = commonApi.addPrice(accountInfo.getPrice(), sa.getSeleep());
        commonApi.setPrice(bigDecimal,accountInfo.getId(),sa);

        TaobaoClient client = new DefaultTaobaoClient(OutUrlConstant.JYMURL, sa.getSaleKey(), sa.getOther());
        long time = new Date().getTime();
        Long jymid = accountInfo.getJymid();
        if (null != jymid) {
            AlibabaJymItemExternalGoodsBatchModifypriceRequest req = new AlibabaJymItemExternalGoodsBatchModifypriceRequest();
            AlibabaJymItemExternalGoodsBatchModifypriceRequest.GoodsPriceModifyCommandDto obj1 = new AlibabaJymItemExternalGoodsBatchModifypriceRequest.GoodsPriceModifyCommandDto();
            List<AlibabaJymItemExternalGoodsBatchModifypriceRequest.GoodsPriceDto> list3 = new ArrayList<AlibabaJymItemExternalGoodsBatchModifypriceRequest.GoodsPriceDto>();
            AlibabaJymItemExternalGoodsBatchModifypriceRequest.GoodsPriceDto obj4 = new AlibabaJymItemExternalGoodsBatchModifypriceRequest.GoodsPriceDto();
            AlibabaJymItemExternalGoodsBatchModifypriceRequest.ExternalGoodsIdDto obj6 = new AlibabaJymItemExternalGoodsBatchModifypriceRequest.ExternalGoodsIdDto();
            obj6.setGoodsId(accountInfo.getJymid());
            obj6.setExternalGoodsId(accountInfo.getId().toString() + getVersion());
            obj4.setPrice(bigDecimal.toPlainString());
            list3.add(obj4);
            obj4.setExternalGoodsId(obj6);
            obj1.setGoodsPriceList(list3);
//            obj1.setExternalBatchId("" + time);
            obj1.setExternalBatchId(UUIDGenerator.generate12());
            req.setGoodsPriceModifyCommand(obj1);
            AlibabaJymItemExternalGoodsBatchModifypriceResponse rsp = null;
            try {
                rsp = client.execute(req);
            } catch (ApiException e) {
                e.printStackTrace();
            }
            log.info("交易猫请求参数:{}", JSONObject.toJSONString(obj1));
            log.info("交易猫返回参数:{}", rsp.getBody());
            if (Objects.nonNull(rsp.getSucceed()) && rsp.getSucceed() != false) {

                AlibabaJymItemExternalGoodsBatchModifypriceResponse.GoodsBatchResultDto result = rsp.getResult();
                if (result != null) {
                    Long batchId = result.getBatchId();
                    if (batchId != null) {
                        setJymTask(accountInfo,batchId, LCConstant.interEdit);
                        HashMap<String, Object> res = new HashMap<>();
                        res.put("req", JSONObject.toJSONString(obj1));
                        res.put("res", rsp.getBody());
                        res.put("msg", rsp.getBody());
                        res.put("code", 200);
                        return AjaxResult.success(res);
                    }
                }
            }

            if (accountInfo.getJymBatchId() == null) {
                log.error("交易猫发布商品失败:{}", rsp.getBody());
                HashMap<String, Object> res = new HashMap<>();
                res.put("req", JSONObject.toJSONString(obj1));
                res.put("res", rsp.getBody());
                res.put("msg", rsp.getBody());
                res.put("code", 500);
                return AjaxResult.success(res);
            }
        }
        HashMap<String, Object> res = new HashMap<>();
        res.put("req", "");
        res.put("res", "");
        res.put("msg", "交易猫ID为空");
        res.put("code", 500);
        return AjaxResult.success(res);
    }

    @Override
    public AjaxResult delGame(AccountInfo accountInfo, Long userId, SalePartner sa) {

        TaobaoClient client = new DefaultTaobaoClient(OutUrlConstant.JYMURL, sa.getSaleKey(), sa.getOther());
        AlibabaJymItemExternalGoodsBatchOffsaleRequest req = new AlibabaJymItemExternalGoodsBatchOffsaleRequest();
        AlibabaJymItemExternalGoodsBatchOffsaleRequest.GoodsOffSaleCommandDto obj1 = new AlibabaJymItemExternalGoodsBatchOffsaleRequest.GoodsOffSaleCommandDto();
        List<AlibabaJymItemExternalGoodsBatchOffsaleRequest.ExternalGoodsIdDto> list3 = new ArrayList<AlibabaJymItemExternalGoodsBatchOffsaleRequest.ExternalGoodsIdDto>();
        AlibabaJymItemExternalGoodsBatchOffsaleRequest.ExternalGoodsIdDto obj4 = new AlibabaJymItemExternalGoodsBatchOffsaleRequest.ExternalGoodsIdDto();
        list3.add(obj4);
        obj4.setExternalGoodsId(accountInfo.getId().toString() + getVersion());
        obj4.setGoodsId(accountInfo.getJymid());
        obj1.setExternalGoodsIdList(list3);
//        String replace = UUID.randomUUID().toString().replace("-", "");
        obj1.setExternalBatchId(UUIDGenerator.generate12());
        req.setGoodsOffSaleCommand(obj1);
        AlibabaJymItemExternalGoodsBatchOffsaleResponse rsp = null;
        try {
            rsp = client.execute(req);
        } catch (ApiException e) {
            e.printStackTrace();
        }
        log.info("交易猫下架请求参数:{}", JSONObject.toJSONString(obj1));
        log.info("交易猫下架请求参数={}", rsp.getBody());
        if (Objects.nonNull(rsp.getSucceed()) && rsp.getSucceed() == true) {

            AlibabaJymItemExternalGoodsBatchOffsaleResponse.GoodsBatchResultDto result = rsp.getResult();
            if (result != null) {
                Long batchId = result.getBatchId();
                if (batchId != null) {
                    setJymTask(accountInfo,batchId, LCConstant.interDel);
                    HashMap<String, Object> res = new HashMap<>();
                    res.put("req", JSONObject.toJSONString(obj1));
                    res.put("res", rsp.getBody());
                    res.put("msg", rsp.getBody());
                    res.put("code", 200);
                    return AjaxResult.success(res);
                }
            }
        }
        Map<String, Object> result = new HashMap<>();
        result.put("code", 500);
        result.put("req", JSONObject.toJSONString(obj1));
        result.put("res", "下架失败");
        result.put("msg", "下架失败");
        return AjaxResult.success(result);
    }

    @Override
    public void relDelGame(AccountInfo info, Long createId, SalePartner salePartner) {

    }

    //1657463101289429
    private Map<String, Object> params(AccountInfo accountInfo, String add, SalePartner sa) {
        String type = accountInfo.getType();
        String regional = accountInfo.getRegional();

        String levle = "";
        if ("包人脸".equals(accountInfo.getLevel())) {
            levle = "可人脸";
        } else if ("有二次".equals(accountInfo.getLevel())) {
            levle = "可二次";
        } else {
            levle = accountInfo.getLevel();
        }

        String des = accountInfo.getLevel() + "  " + accountInfo.getDes();
        String pattern = "[1-9]([0-9]{1,8})";
        des = Pattern.compile(pattern).matcher(des).replaceAll("");


        if (StringUtils.isNotEmpty(des)) {
            des = (des.length() < 200 ? des : des.substring(0, 100));
        }

      /*  ：防沉迷、包人脸、身份证、实名信息，身份证号码，实名，人脸验证
        未成年词：小学、初中、高中（有几率会判罚）
        游戏敏感信息：王者营地ID（截图以及标题描述都不可以出现）、包赔（图片&文字）
        联系方式：Q号、手机号、微信号*/

        des = des.replace("包人脸", "").replace("营地号", "")
                .replace("人脸", "")
                .replace("有二次", "可二次")
                .replace("实名", "")
                .replace("未成年人", "")
                .replace("暑假", "")
                .replace("高中", "")
                .replace("防沉迷", "")
                .replace("身份证", "")
                .replace("实名信息", "")
                .replace("身份证号码", "")
                .replace("实名", "")
                .replace("人脸验证", "")
                .replace("未成年词", "")
                .replace("小学", "")
                .replace("初中", "")
                .replace("高中", "")
                .replace("营地ID", "")
                .replace("Q号", "")
                .replace("Q", "扣")
                .replace("WX", "V")
                .replace("QQ号", "")
                .replace("手机号", "")
                .replace("微信号", "V")
                .replace("初中", "")
                .replace("到删", "")
                .replace("到删除", "")
                .replace("到除", "")
                .replace("小学", "");

        if (Objects.nonNull(accountInfo.getCampId())) {
            des = des.replace(accountInfo.getCampId(), "");
        }
        des = descTitle + accountInfo.getId() + "|" + des;

        TaobaoClient client = new DefaultTaobaoClient(OutUrlConstant.JYMURL, sa.getSaleKey(), sa.getOther());

        //只有王者荣耀
        if (GameTypeConstant.WZRY.equals(type)) {

            des = "英雄:" + accountInfo.getHeroes() + " " + "皮肤:" + accountInfo.getSkins() + des;

            String version = getVersion();
            AlibabaJymItemExternalGoodsBatchPublishRequest req = new AlibabaJymItemExternalGoodsBatchPublishRequest();
            AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishCommandDto obj1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishCommandDto();
            String replace = UUID.randomUUID().toString().replace("-", "");
            obj1.setExternalBatchId(accountInfo.getId() + getVersion());
            List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishDto> list3 = new ArrayList<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishDto>();
            AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishDto obj4 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishDto();
            obj4.setSupportRetrieveCompensation(true);
            //游戏类型参数
            List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto> list7 = new ArrayList<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto>();
            AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto obj8 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
            String extractAccount = descTitle + "--" + accountInfo.getId() + version;
            String extractPwd = "123456";
            //游戏账号
            switch (regional) {
                case "安卓Q":
                    obj8.setPropertyId(1642579782531115L);
                    break;
                case "安卓WX":
                    obj8.setPropertyId(1642579812114113L);
                    break;
                case "苹果Q":
                    obj8.setPropertyId(1642580017622083L);
                    break;
                case "苹果WX":
                    obj8.setPropertyId(1642581061807099L);
                    break;
            }
            if (StringUtils.isEmpty(extractAccount)) {
                obj8.setValue(AESUtil.encrypt(com.ruoyi.common.utils.uuid.UUID.fastUUID().toString().replace("-", "").substring(0, 6), aesKey));
            } else {
                obj8.setValue(AESUtil.encrypt(extractAccount, aesKey));
            }
            list7.add(obj8);
            obj8 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
            //游戏密码
            switch (regional) {
                case "安卓Q":
                    obj8.setPropertyId(1642579782544142L);
                    break;
                case "安卓WX":
                    obj8.setPropertyId(1642579812122125L);
                    break;
                case "苹果Q":
                    obj8.setPropertyId(1642580017630093L);
                    break;
                case "苹果WX":
                    obj8.setPropertyId(1642581061809102L);
                    break;
            }
            if (StringUtils.isEmpty(extractPwd)) {
                obj8.setValue(AESUtil.encrypt(com.ruoyi.common.utils.uuid.UUID.fastUUID().toString().replace("-", "").substring(0, 6), aesKey));
            } else {
                obj8.setValue(AESUtil.encrypt(extractPwd, aesKey));
            }
            list7.add(obj8);
            obj8 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
            //手机号
            switch (regional) {
                case "安卓Q":
                    obj8.setPropertyId(1642579783134053L);
                    obj8.setValue(AESUtil.encrypt("13943421979", aesKey));
                    list7.add(obj8);
                    break;
                case "安卓WX":
                    obj8.setPropertyId(1646706059915376L);
                    obj8.setValue(AESUtil.encrypt("13943421979", aesKey));
                    list7.add(obj8);
                    break;
                case "苹果Q":
                    obj8.setPropertyId(1642580018345655L);
                    obj8.setValue(AESUtil.encrypt("13943421979", aesKey));
                    list7.add(obj8);
                    break;
                case "苹果WX":
                    obj8.setPropertyId(1642581062403440L);
                    obj8.setValue(AESUtil.encrypt("13943421979", aesKey));
                    list7.add(obj8);
                    break;
            }
            obj4.setSellerAccountPropertyList(list7);

            List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto> list11 = new ArrayList<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto>();
            AlibabaJymItemExternalGoodsBatchPublishRequest.GamePropertyDto obj14 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GamePropertyDto();
            obj14.setServerId(JYMRegionalCovert.getServerId(type, regional));
            obj14.setClientId(JYMRegionalCovert.getClientId(type, regional));
            obj14.setPlatformId(JYMRegionalCovert.getPlanformId(type, regional));
            obj14.setGameId(JYMRegionalCovert.getGameId(type));
            obj4.setGameProperty(obj14);
            obj4.setSecondCategoryId(JYMRegionalCovert.getSecondCategoryId(type, regional));
            obj4.setFirstCategoryId(JYMRegionalCovert.getFirstCategoryId());

            list11 = goodspropertyParams(accountInfo, list11, regional);


            obj4.setGoodsPropertyList(list11);

            List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto> list17 = new ArrayList<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto>();
            AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto obj18 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto();
            //图片
            InfoImg infoImg = new InfoImg();
            infoImg.setInfoId(accountInfo.getId());
            infoImg.setType(Constants.STR_1);
            List<InfoImg> infoImgs = infoImgMapper.selectInfoImgList(infoImg);
            if (infoImgs.size() > 19) {
                infoImgs = infoImgs.subList(0, 19);
            }
            if (CollectionUtils.isEmpty(infoImgs)) {
                obj18.setImageUrl("https://game.ikbh.top/logo/no_img.jpg");
                list17.add(obj18);
            } else {
                for (InfoImg img : infoImgs) {
                    String imgUrl = img.getImgUrl();
                    if (!imgUrl.contains("https")) {
                        imgUrl = imgUrl.replace("http", "https");
                    }
                    boolean b = true;
                    try {
                        b = sensitiveScan(img.getImgUrl());
                    } catch (Exception e) {
                        throw new GlobalException("图片解析失败");
                    }
                    if (b) {
                        obj18 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto();
                        obj18.setImageUrl(imgUrl);
                        list17.add(obj18);
                    }
                }
            }
            obj4.setImageUrlList(list17);

            String level = accountInfo.getLevel();
            if (Objects.equals(LCConstant.bakFace, level)) {
                level = LCConstant.bakFaceTo;
            }
            AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsBaseInfoDto obj20 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsBaseInfoDto();

//        鸣剑曳影，小国标，找回包赔，枫霜尽，国服号，已验号，九霄神辉，全息碎影，星空梦想，天鹅之梦，无限飓风号，唐三藏，电玩高手，无双飞将，无尽星芒，深海之息，唤灵魅影，奇遇舞章

            StringBuffer title = new StringBuffer();
            title.append(levle + " ");

            SysDictData sysDictData = new SysDictData();
            sysDictData.setDictType("jym_hot_word");
            sysDictData.setStatus(Constants.STR_0);
            List<SysDictData> sysDictDataList = sysDictDataMapper.selectDictDataList(sysDictData);
            for (SysDictData dictData : sysDictDataList) {
                if (des.contains(dictData.getDictLabel())) {
                    title.append(dictData.getDictLabel() + " ");
                }
            }


            if (title.length() > 15) {
                obj20.setTitle(title.substring(0, 15));
            } else {
                title.append(des);
                obj20.setTitle(title.substring(0, 15));
            }
            if (Objects.isNull(accountInfo.getPrice())) {
                obj20.setPrice("999");
            } else {
                BigDecimal bigDecimal = commonApi.addPrice(accountInfo.getPrice(), sa.getSeleep());
                commonApi.setPrice(bigDecimal,accountInfo.getId(),sa);
                obj20.setPrice(bigDecimal.toString());
            }

            if (StringUtils.isNotEmpty(des)) {
                obj20.setDescription(des.length() < 200 ? des : des.substring(0, 199));
            }
            obj20.setStorage(1L);
            obj4.setGoodsBaseInfo(obj20);
            obj4.setExternalGoodsId(accountInfo.getId() + "" + getVersion());
            obj4.setCanBargain(true);
            list3.add(obj4);
            obj1.setGoodsList(list3);

            req.setGoodsPublishCommand(obj1);
            AlibabaJymItemExternalGoodsBatchPublishResponse rsp = null;
            try {
                rsp = client.execute(req);
            } catch (ApiException e) {
                e.printStackTrace();
            }
            log.info("交易猫请求参数:{}", JSONObject.toJSONString(obj1));
            log.info("交易猫返回参数:{}", rsp.getBody());
            if (Objects.nonNull(rsp.getSucceed()) && rsp.getSucceed() != false) {
                AlibabaJymItemExternalGoodsBatchPublishResponse.GoodsBatchResultDto result = rsp.getResult();
                if (result != null) {
                    Long batchId = result.getBatchId();
                    if (batchId != null) {
                        AccountInfo info = accountInfoMapper.selectAccountInfoById(accountInfo.getId());
                        info.setJymBatchId(batchId);
                        info.setUpdateTime(new Date());
                        accountInfoMapper.updateAccountInfo(info);
                        setJymTask(accountInfo,batchId, LCConstant.interAdd);
                        HashMap<String, Object> res = new HashMap<>();
                        res.put("req", JSONObject.toJSONString(obj1));
                        res.put("res", rsp.getBody());
                        res.put("msg", rsp.getBody());
                        res.put("code", 200);
                        return res;
                    }
                }
            }
            if (accountInfo.getJymBatchId() == null) {
                log.error("交易猫发布商品失败:{}", rsp.getBody());
                HashMap<String, Object> res = new HashMap<>();
                res.put("req", JSONObject.toJSONString(obj1));
                res.put("res", rsp.getBody());
                res.put("msg", rsp.getBody());
                res.put("code", 500);
                return res;
            }
        }
        if (GameTypeConstant.HPJY.equals(type)) {

            des = "枪皮:" + accountInfo.getGuns() + " " + "套装:" + accountInfo.getSuit() + des;

            AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishCommandDto goodsPublishCommandDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishCommandDto();
//            String replace = UUID.randomUUID().toString().replace("-", "");
            goodsPublishCommandDto.setExternalBatchId(accountInfo.getId() + getVersion());

            if (Objects.equals("安卓Q", accountInfo.getRegional())) {

                List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishDto> goodsPublishDtoList = new ArrayList<>();
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishDto goodsPublishDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishDto();
                goodsPublishDto.setSupportRetrieveCompensation(true);

                List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto> goodsPropertyValueDtoList = new ArrayList<>();
                //账号
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto goodsPropertyValueDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                long accOunt = new Date().getTime();
                goodsPropertyValueDto.setValue(AESUtil.encrypt(String.valueOf(accOunt), aesKey));
                goodsPropertyValueDto.setPropertyId(1645695622683132l);
                goodsPropertyValueDtoList.add(goodsPropertyValueDto);

                //密码
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto goodsPropertyValueDtoPwd = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                long pwd = new Date().getTime();
                goodsPropertyValueDtoPwd.setValue(AESUtil.encrypt(String.valueOf(pwd), aesKey));
                goodsPropertyValueDtoPwd.setPropertyId(1645695622900357l);
                goodsPropertyValueDtoList.add(goodsPropertyValueDtoPwd);

                //角色名称
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto goodsPropertyValueDtoMing = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                goodsPropertyValueDtoMing.setValue(AESUtil.encrypt("问客服", aesKey));
                goodsPropertyValueDtoMing.setPropertyId(1645695623021477l);
                goodsPropertyValueDtoList.add(goodsPropertyValueDtoMing);


                //手机号
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto goodsPropertyValueDtoTel = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                goodsPropertyValueDtoTel.setValue(AESUtil.encrypt("17737053518", aesKey));
                goodsPropertyValueDtoTel.setPropertyId(1645695623799443l);
                goodsPropertyValueDtoList.add(goodsPropertyValueDtoTel);

                goodsPublishDto.setSellerAccountPropertyList(goodsPropertyValueDtoList);

                //数量
                List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto> propertyValueDtoListArr = new ArrayList<>();
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                //稀有枪械
                goodsPropertyValueDto1.setPropertyId(1645695622686134l);
                goodsPropertyValueDto1.setValue("无");
                propertyValueDtoListArr.add(goodsPropertyValueDto1);

                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                //稀有载
                goodsPropertyValueDto1.setPropertyId(1645695622903359l);
                goodsPropertyValueDto1.setValue("无");
                propertyValueDtoListArr.add(goodsPropertyValueDto1);

                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                //稀有飞行器
                goodsPropertyValueDto1.setPropertyId(1645695623024480l);
                goodsPropertyValueDto1.setValue("无");
                propertyValueDtoListArr.add(goodsPropertyValueDto1);

                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                //稀有降落伞
                goodsPropertyValueDto1.setPropertyId(1645695623047503l);
                goodsPropertyValueDto1.setValue("无");
                propertyValueDtoListArr.add(goodsPropertyValueDto1);

                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                //稀有时装
                goodsPropertyValueDto1.setPropertyId(1645695623447135l);
                goodsPropertyValueDto1.setValue("无");
                propertyValueDtoListArr.add(goodsPropertyValueDto1);

                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                //段位
                goodsPropertyValueDto1.setPropertyId(1645695623683352l);
                goodsPropertyValueDto1.setValue("问客服");
                propertyValueDtoListArr.add(goodsPropertyValueDto1);

                //成人号
                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                goodsPropertyValueDto1.setPropertyId(1645695623704368l);
                if (Arrays.asList(LCConstant.haveTwoList).contains(accountInfo.getLevel())) {
                    goodsPropertyValueDto1.setValue("无");
                } else {
                    goodsPropertyValueDto1.setValue("有");
                }
                propertyValueDtoListArr.add(goodsPropertyValueDto1);

                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                goodsPropertyValueDto1.setPropertyId(1645695623718375l);
                goodsPropertyValueDto1.setValue("6");
                propertyValueDtoListArr.add(goodsPropertyValueDto1);

                goodsPublishDto.setGoodsPropertyList(propertyValueDtoListArr);


                AlibabaJymItemExternalGoodsBatchPublishRequest.GamePropertyDto gamePropertyDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GamePropertyDto();

                gamePropertyDto.setGameId(1006473l);
                gamePropertyDto.setPlatformId(2l);
                gamePropertyDto.setClientId(1470047031091455l);
                gamePropertyDto.setServerId(1535364157745866l);

                goodsPublishDto.setGameProperty(gamePropertyDto);

                Long secondCategoryId = JYMRegionalCovert.getSecondCategoryId(type, regional);
                goodsPublishDto.setSecondCategoryId(secondCategoryId);
                goodsPublishDto.setFirstCategoryId(1l);

                List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto> goodsPublishImageDtosList = new ArrayList<>();
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto goodsPublishImageDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto();
                //图片
                InfoImg infoImg = new InfoImg();
                infoImg.setInfoId(accountInfo.getId());
                infoImg.setType(Constants.STR_1);
                List<InfoImg> infoImgs = infoImgMapper.selectInfoImgList(infoImg);
                if (infoImgs.size() > 19) {
                    infoImgs = infoImgs.subList(0, 19);
                }
                if (CollectionUtils.isEmpty(infoImgs)) {
                    goodsPublishImageDto.setImageUrl("https://game.ikbh.top/logo/no_img.jpg");
                    goodsPublishImageDtosList.add(goodsPublishImageDto);
                } else {
                    for (InfoImg img : infoImgs) {
                        String imgUrl = img.getImgUrl();
                        if (!imgUrl.contains("https")) {
                            imgUrl = imgUrl.replace("http", "https");
                        }
                        boolean b = true;
                        try {
                            b = sensitiveScan(img.getImgUrl());
                        } catch (Exception e) {
                            throw new GlobalException("图片解析失败");
                        }
                        if (b) {
                            goodsPublishImageDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto();
                            goodsPublishImageDto.setImageUrl(imgUrl);
                            goodsPublishImageDtosList.add(goodsPublishImageDto);
                        }
                    }
                }
                goodsPublishDto.setImageUrlList(goodsPublishImageDtosList);


                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsBaseInfoDto goodsBaseInfoDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsBaseInfoDto();

                StringBuffer title = new StringBuffer();
//                title.append("【" + accountInfo.getSuit() + "枪皮" + accountInfo.getGuns()+ "套装" + "】" + levle);

                SysDictData sysDictData = new SysDictData();
                sysDictData.setDictType("jym_hot_word");
                sysDictData.setStatus(Constants.STR_0);
                List<SysDictData> sysDictDataList = sysDictDataMapper.selectDictDataList(sysDictData);
                for (SysDictData dictData : sysDictDataList) {
                    if (des.contains(dictData.getDictLabel())) {
                        title.append(dictData.getDictLabel() + " ");
                    }
                }
                String title1 = title.toString();
                if (title1.length() > 15){
                    title1 = title.toString().substring(0, 15);
                }else {
                    title1 = des.substring(0, 15);
                }
                goodsBaseInfoDto.setTitle(title1);
                if (accountInfo.getPrice().compareTo(new BigDecimal(100)) > 0) {
                    BigDecimal bigDecimal = commonApi.addPrice(accountInfo.getPrice(), sa.getSeleep());
                    commonApi.setPrice(bigDecimal,accountInfo.getId(),sa);
                    goodsBaseInfoDto.setPrice(bigDecimal.toPlainString());
                } else {
                    goodsBaseInfoDto.setPrice("119");
                }
                goodsBaseInfoDto.setStorage(1l);
                goodsBaseInfoDto.setDescription(des);

                goodsPublishDto.setGoodsBaseInfo(goodsBaseInfoDto);

                goodsPublishDto.setExternalGoodsId(accountInfo.getId() + getVersion());
                goodsPublishDto.setCanBargain(true);

                goodsPublishDtoList.add(goodsPublishDto);
                goodsPublishCommandDto.setGoodsList(goodsPublishDtoList);
            } else if (Objects.equals("安卓WX", accountInfo.getRegional())) {


                List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishDto> goodsPublishDtoList = new ArrayList<>();
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishDto goodsPublishDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishDto();
                goodsPublishDto.setSupportRetrieveCompensation(true);

                List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto> goodsPropertyValueDtoList = new ArrayList<>();
                //账号
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto goodsPropertyValueDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                long accOunt = new Date().getTime();
                goodsPropertyValueDto.setValue(AESUtil.encrypt(String.valueOf(accOunt), aesKey));
                goodsPropertyValueDto.setPropertyId(1645695787036425l);
                goodsPropertyValueDtoList.add(goodsPropertyValueDto);

                //密码
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto goodsPropertyValueDtoPwd = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                long pwd = new Date().getTime();
                goodsPropertyValueDtoPwd.setValue(AESUtil.encrypt(String.valueOf(pwd), aesKey));
                goodsPropertyValueDtoPwd.setPropertyId(1645695787038426l);
                goodsPropertyValueDtoList.add(goodsPropertyValueDtoPwd);

                //角色名称
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto goodsPropertyValueDtoMing = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                goodsPropertyValueDtoMing.setValue(AESUtil.encrypt("问客服", aesKey));
                goodsPropertyValueDtoMing.setPropertyId(1645695787187063l);
                goodsPropertyValueDtoList.add(goodsPropertyValueDtoMing);


                //手机号
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto goodsPropertyValueDtoTel = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                goodsPropertyValueDtoTel.setValue(AESUtil.encrypt("17737053518", aesKey));
                goodsPropertyValueDtoTel.setPropertyId(1645695787321103l);
                goodsPropertyValueDtoList.add(goodsPropertyValueDtoTel);

                goodsPublishDto.setSellerAccountPropertyList(goodsPropertyValueDtoList);

                //数量
                List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto> propertyValueDtoListArr = new ArrayList<>();
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                //稀有枪械
                goodsPropertyValueDto1.setPropertyId(1645695786836215l);
                goodsPropertyValueDto1.setValue("无");
                propertyValueDtoListArr.add(goodsPropertyValueDto1);

                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                //稀有载
                goodsPropertyValueDto1.setPropertyId(1645695787041427l);
                goodsPropertyValueDto1.setValue("无");
                propertyValueDtoListArr.add(goodsPropertyValueDto1);

                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                //稀有飞行器
                goodsPropertyValueDto1.setPropertyId(1645695787189067l);
                goodsPropertyValueDto1.setValue("无");
                propertyValueDtoListArr.add(goodsPropertyValueDto1);

//                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
//                //稀有降落伞
//                goodsPropertyValueDto1.setPropertyId(1645695623047503l);
//                goodsPropertyValueDto1.setValue("无");
//                propertyValueDtoListArr.add(goodsPropertyValueDto1);

                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                //稀有时装
                goodsPropertyValueDto1.setPropertyId(1650944351236680l);
                goodsPropertyValueDto1.setValue("无");
                propertyValueDtoListArr.add(goodsPropertyValueDto1);

//                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
//                //段位
//                goodsPropertyValueDto1.setPropertyId(1645695623683352l);
//                goodsPropertyValueDto1.setValue("问客服");
//                propertyValueDtoListArr.add(goodsPropertyValueDto1);

                //成人号
                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                goodsPropertyValueDto1.setPropertyId(1645695787230120l);
                if (Arrays.asList(LCConstant.haveTwoList).contains(accountInfo.getLevel())) {
                    goodsPropertyValueDto1.setValue("无");
                } else {
                    goodsPropertyValueDto1.setValue("有");
                }
                propertyValueDtoListArr.add(goodsPropertyValueDto1);
                //帐号绑定
                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                goodsPropertyValueDto1.setPropertyId(1645695787237003l);
                goodsPropertyValueDto1.setValue("6");
                propertyValueDtoListArr.add(goodsPropertyValueDto1);

                goodsPublishDto.setGoodsPropertyList(propertyValueDtoListArr);


                AlibabaJymItemExternalGoodsBatchPublishRequest.GamePropertyDto gamePropertyDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GamePropertyDto();

                gamePropertyDto.setGameId(1006473l);
                gamePropertyDto.setPlatformId(2l);
                gamePropertyDto.setClientId(1470047033047733l);
                gamePropertyDto.setServerId(1539844286658920l);

                goodsPublishDto.setGameProperty(gamePropertyDto);

                Long secondCategoryId = JYMRegionalCovert.getSecondCategoryId(type, regional);
                goodsPublishDto.setSecondCategoryId(secondCategoryId);
                goodsPublishDto.setFirstCategoryId(1l);

                List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto> goodsPublishImageDtosList = new ArrayList<>();
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto goodsPublishImageDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto();
                //图片
                InfoImg infoImg = new InfoImg();
                infoImg.setInfoId(accountInfo.getId());
                infoImg.setType(Constants.STR_1);
                List<InfoImg> infoImgs = infoImgMapper.selectInfoImgList(infoImg);
                if (infoImgs.size() > 19) {
                    infoImgs = infoImgs.subList(0, 19);
                }
                if (CollectionUtils.isEmpty(infoImgs)) {
                    goodsPublishImageDto.setImageUrl("https://game.ikbh.top/logo/no_img.jpg");
                    goodsPublishImageDtosList.add(goodsPublishImageDto);
                } else {
                    for (InfoImg img : infoImgs) {
                        String imgUrl = img.getImgUrl();
                        if (!imgUrl.contains("https")) {
                            imgUrl = imgUrl.replace("http", "https");
                        }
                        boolean b = true;
                        try {
                            b = sensitiveScan(img.getImgUrl());
                        } catch (Exception e) {
                            throw new GlobalException("图片解析失败");
                        }
                        if (b) {
                            goodsPublishImageDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto();
                            goodsPublishImageDto.setImageUrl(imgUrl);
                            goodsPublishImageDtosList.add(goodsPublishImageDto);
                        }
                    }
                }
                goodsPublishDto.setImageUrlList(goodsPublishImageDtosList);


                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsBaseInfoDto goodsBaseInfoDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsBaseInfoDto();

                StringBuffer title = new StringBuffer();
//                title.append("【" + accountInfo.getSuit() + "枪皮" + accountInfo.getGuns()+ "套装" + "】" + levle);

                SysDictData sysDictData = new SysDictData();
                sysDictData.setDictType("jym_hot_word");
                sysDictData.setStatus(Constants.STR_0);
                List<SysDictData> sysDictDataList = sysDictDataMapper.selectDictDataList(sysDictData);
                for (SysDictData dictData : sysDictDataList) {
                    if (des.contains(dictData.getDictLabel())) {
                        title.append(dictData.getDictLabel() + " ");
                    }
                }
                String title1 = title.toString();
                if (title1.length() > 15){
                    title1 = title.toString().substring(0, 15);
                }else {
                    title1 = des.substring(0,15);
                }
                goodsBaseInfoDto.setTitle(title1);
                if (accountInfo.getPrice().compareTo(new BigDecimal(100)) > 0) {
                    BigDecimal bigDecimal = commonApi.addPrice(accountInfo.getPrice(), sa.getSeleep());
                    commonApi.setPrice(bigDecimal,accountInfo.getId(),sa);
                    goodsBaseInfoDto.setPrice(bigDecimal.toPlainString());
                } else {
                    goodsBaseInfoDto.setPrice("119");
                }
                goodsBaseInfoDto.setStorage(1l);
                goodsBaseInfoDto.setDescription(des);

                goodsPublishDto.setGoodsBaseInfo(goodsBaseInfoDto);

                goodsPublishDto.setExternalGoodsId(accountInfo.getId() + getVersion());
                goodsPublishDto.setCanBargain(true);

                goodsPublishDtoList.add(goodsPublishDto);
                goodsPublishCommandDto.setGoodsList(goodsPublishDtoList);
            } else if (Objects.equals("苹果Q", accountInfo.getRegional())) {

                List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishDto> goodsPublishDtoList = new ArrayList<>();
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishDto goodsPublishDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishDto();
                goodsPublishDto.setSupportRetrieveCompensation(true);

                List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto> goodsPropertyValueDtoList = new ArrayList<>();
                //账号
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto goodsPropertyValueDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                long accOunt = new Date().getTime();
                goodsPropertyValueDto.setValue(AESUtil.encrypt(String.valueOf(accOunt), aesKey));
                goodsPropertyValueDto.setPropertyId(1645695907347329l);
                goodsPropertyValueDtoList.add(goodsPropertyValueDto);

                //密码
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto goodsPropertyValueDtoPwd = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                long pwd = new Date().getTime();
                goodsPropertyValueDtoPwd.setValue(AESUtil.encrypt(String.valueOf(pwd), aesKey));
                goodsPropertyValueDtoPwd.setPropertyId(1645695907458455l);
                goodsPropertyValueDtoList.add(goodsPropertyValueDtoPwd);

                //角色名称
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto goodsPropertyValueDtoMing = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                goodsPropertyValueDtoMing.setValue(AESUtil.encrypt("问客服", aesKey));
                goodsPropertyValueDtoMing.setPropertyId(1645695907460457l);
                goodsPropertyValueDtoList.add(goodsPropertyValueDtoMing);


                //手机号
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto goodsPropertyValueDtoTel = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                goodsPropertyValueDtoTel.setValue(AESUtil.encrypt("17737053518", aesKey));
                goodsPropertyValueDtoTel.setPropertyId(1645695907607079l);
                goodsPropertyValueDtoList.add(goodsPropertyValueDtoTel);

                goodsPublishDto.setSellerAccountPropertyList(goodsPropertyValueDtoList);

                //数量
                List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto> propertyValueDtoListArr = new ArrayList<>();
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                //稀有枪械
                goodsPropertyValueDto1.setPropertyId(1645695907136144l);
                goodsPropertyValueDto1.setValue("无");
                propertyValueDtoListArr.add(goodsPropertyValueDto1);

                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                //稀有载
                goodsPropertyValueDto1.setPropertyId(1645695907349331l);
                goodsPropertyValueDto1.setValue("无");
                propertyValueDtoListArr.add(goodsPropertyValueDto1);

                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                //稀有飞行器
                goodsPropertyValueDto1.setPropertyId(1645695907462458l);
                goodsPropertyValueDto1.setValue("无");
                propertyValueDtoListArr.add(goodsPropertyValueDto1);

//                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
//                //稀有降落伞
//                goodsPropertyValueDto1.setPropertyId(1645695623047503l);
//                goodsPropertyValueDto1.setValue("无");
//                propertyValueDtoListArr.add(goodsPropertyValueDto1);

                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                //稀有时装
                goodsPropertyValueDto1.setPropertyId(1650945194451106l);
                goodsPropertyValueDto1.setValue("无");
                propertyValueDtoListArr.add(goodsPropertyValueDto1);

//                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
//                //段位
//                goodsPropertyValueDto1.setPropertyId(1645695623683352l);
//                goodsPropertyValueDto1.setValue("问客服");
//                propertyValueDtoListArr.add(goodsPropertyValueDto1);

                //成人号
                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                goodsPropertyValueDto1.setPropertyId(1645695907513513l);
                if (Arrays.asList(LCConstant.haveTwoList).contains(accountInfo.getLevel())) {
                    goodsPropertyValueDto1.setValue("无");
                } else {
                    goodsPropertyValueDto1.setValue("有");
                }
                propertyValueDtoListArr.add(goodsPropertyValueDto1);
                //帐号绑定
                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                goodsPropertyValueDto1.setPropertyId(1645695907525524l);
                goodsPropertyValueDto1.setValue("6");
                propertyValueDtoListArr.add(goodsPropertyValueDto1);

                goodsPublishDto.setGoodsPropertyList(propertyValueDtoListArr);


                AlibabaJymItemExternalGoodsBatchPublishRequest.GamePropertyDto gamePropertyDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GamePropertyDto();

                gamePropertyDto.setGameId(1006473l);
                gamePropertyDto.setPlatformId(3l);
                gamePropertyDto.setClientId(1470047031280559l);
                gamePropertyDto.setServerId(1535364178344308l);

                goodsPublishDto.setGameProperty(gamePropertyDto);

                Long secondCategoryId = JYMRegionalCovert.getSecondCategoryId(type, regional);
                goodsPublishDto.setSecondCategoryId(secondCategoryId);
                goodsPublishDto.setFirstCategoryId(1l);

                List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto> goodsPublishImageDtosList = new ArrayList<>();
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto goodsPublishImageDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto();
                //图片
                InfoImg infoImg = new InfoImg();
                infoImg.setInfoId(accountInfo.getId());
                infoImg.setType(Constants.STR_1);
                List<InfoImg> infoImgs = infoImgMapper.selectInfoImgList(infoImg);
                if (infoImgs.size() > 19) {
                    infoImgs = infoImgs.subList(0, 19);
                }
                if (CollectionUtils.isEmpty(infoImgs)) {
                    goodsPublishImageDto.setImageUrl("https://game.ikbh.top/logo/no_img.jpg");
                    goodsPublishImageDtosList.add(goodsPublishImageDto);
                } else {
                    for (InfoImg img : infoImgs) {
                        String imgUrl = img.getImgUrl();
                        if (!imgUrl.contains("https")) {
                            imgUrl = imgUrl.replace("http", "https");
                        }
                        boolean b = true;
                        try {
                            b = sensitiveScan(img.getImgUrl());
                        } catch (Exception e) {
                            throw new GlobalException("图片解析失败");
                        }
                        if (b) {
                            goodsPublishImageDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto();
                            goodsPublishImageDto.setImageUrl(imgUrl);
                            goodsPublishImageDtosList.add(goodsPublishImageDto);
                        }
                    }
                }
                goodsPublishDto.setImageUrlList(goodsPublishImageDtosList);


                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsBaseInfoDto goodsBaseInfoDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsBaseInfoDto();

                StringBuffer title = new StringBuffer();
//                title.append("【" + accountInfo.getSuit() + "枪皮" + accountInfo.getGuns()+ "套装" + "】" + levle);

                SysDictData sysDictData = new SysDictData();
                sysDictData.setDictType("jym_hot_word");
                sysDictData.setStatus(Constants.STR_0);
                List<SysDictData> sysDictDataList = sysDictDataMapper.selectDictDataList(sysDictData);
                for (SysDictData dictData : sysDictDataList) {
                    if (des.contains(dictData.getDictLabel())) {
                        title.append(dictData.getDictLabel() + " ");
                    }
                }

                String title1 = title.toString();
                if (title1.length() > 15){
                    title1 = title.toString().substring(0, 15);
                }else {
                    title1 = des.substring(0,15);
                }
                goodsBaseInfoDto.setTitle(title1);
                if (accountInfo.getPrice().compareTo(new BigDecimal(100)) > 0) {
                    BigDecimal bigDecimal = commonApi.addPrice(accountInfo.getPrice(), sa.getSeleep());
                    commonApi.setPrice(bigDecimal,accountInfo.getId(),sa);
                    goodsBaseInfoDto.setPrice(bigDecimal.toPlainString());
                } else {
                    goodsBaseInfoDto.setPrice("119");
                }
                goodsBaseInfoDto.setStorage(1l);
                goodsBaseInfoDto.setDescription(des);

                goodsPublishDto.setGoodsBaseInfo(goodsBaseInfoDto);

                goodsPublishDto.setExternalGoodsId(accountInfo.getId() + getVersion());
                goodsPublishDto.setCanBargain(true);

                goodsPublishDtoList.add(goodsPublishDto);
                goodsPublishCommandDto.setGoodsList(goodsPublishDtoList);
            } else if (Objects.equals("苹果WX", accountInfo.getRegional())) {

                List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishDto> goodsPublishDtoList = new ArrayList<>();
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishDto goodsPublishDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishDto();
                goodsPublishDto.setSupportRetrieveCompensation(true);

                List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto> goodsPropertyValueDtoList = new ArrayList<>();
                //账号
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto goodsPropertyValueDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                long accOunt = new Date().getTime();
                goodsPropertyValueDto.setValue(AESUtil.encrypt(String.valueOf(accOunt), aesKey));
                goodsPropertyValueDto.setPropertyId(1645695979748163l);
                goodsPropertyValueDtoList.add(goodsPropertyValueDto);

                //密码
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto goodsPropertyValueDtoPwd = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                long pwd = new Date().getTime();
                goodsPropertyValueDtoPwd.setValue(AESUtil.encrypt(String.valueOf(pwd), aesKey));
                goodsPropertyValueDtoPwd.setPropertyId(1645695979753168l);
                goodsPropertyValueDtoList.add(goodsPropertyValueDtoPwd);

                //角色名称
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto goodsPropertyValueDtoMing = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                goodsPropertyValueDtoMing.setValue(AESUtil.encrypt("问客服", aesKey));
                goodsPropertyValueDtoMing.setPropertyId(1645695979875016l);
                goodsPropertyValueDtoList.add(goodsPropertyValueDtoMing);


                //手机号
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto goodsPropertyValueDtoTel = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                goodsPropertyValueDtoTel.setValue(AESUtil.encrypt("17737053518", aesKey));
                goodsPropertyValueDtoTel.setPropertyId(1645695980022144l);
                goodsPropertyValueDtoList.add(goodsPropertyValueDtoTel);

                goodsPublishDto.setSellerAccountPropertyList(goodsPropertyValueDtoList);

                //数量
                List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto> propertyValueDtoListArr = new ArrayList<>();
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                //稀有枪械
                goodsPropertyValueDto1.setPropertyId(1645695979547454l);
                goodsPropertyValueDto1.setValue("无");
                propertyValueDtoListArr.add(goodsPropertyValueDto1);

                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                //稀有载
                goodsPropertyValueDto1.setPropertyId(1645695979756171l);
                goodsPropertyValueDto1.setValue("无");
                propertyValueDtoListArr.add(goodsPropertyValueDto1);

                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                //稀有飞行器
                goodsPropertyValueDto1.setPropertyId(1645695979877019l);
                goodsPropertyValueDto1.setValue("无");
                propertyValueDtoListArr.add(goodsPropertyValueDto1);

//                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
//                //稀有降落伞
//                goodsPropertyValueDto1.setPropertyId(1645695623047503l);
//                goodsPropertyValueDto1.setValue("无");
//                propertyValueDtoListArr.add(goodsPropertyValueDto1);

//                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
//                //稀有时装
//                goodsPropertyValueDto1.setPropertyId(1650945194451106l);
//                goodsPropertyValueDto1.setValue("无");
//                propertyValueDtoListArr.add(goodsPropertyValueDto1);

//                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
//                //段位
//                goodsPropertyValueDto1.setPropertyId(1645695623683352l);
//                goodsPropertyValueDto1.setValue("问客服");
//                propertyValueDtoListArr.add(goodsPropertyValueDto1);

                //成人号
                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                goodsPropertyValueDto1.setPropertyId(1645695979922053l);
                if (Arrays.asList(LCConstant.haveTwoList).contains(accountInfo.getLevel())) {
                    goodsPropertyValueDto1.setValue("无");
                } else {
                    goodsPropertyValueDto1.setValue("有");
                }
                propertyValueDtoListArr.add(goodsPropertyValueDto1);
                //帐号绑定
                goodsPropertyValueDto1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
                goodsPropertyValueDto1.setPropertyId(1645695979930062l);
                goodsPropertyValueDto1.setValue("6");
                propertyValueDtoListArr.add(goodsPropertyValueDto1);

                goodsPublishDto.setGoodsPropertyList(propertyValueDtoListArr);


                AlibabaJymItemExternalGoodsBatchPublishRequest.GamePropertyDto gamePropertyDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GamePropertyDto();

                gamePropertyDto.setGameId(1006473l);
                gamePropertyDto.setPlatformId(3l);
                gamePropertyDto.setClientId(1499667551454656l);
                gamePropertyDto.setServerId(1539844295575679l);

                goodsPublishDto.setGameProperty(gamePropertyDto);

                Long secondCategoryId = JYMRegionalCovert.getSecondCategoryId(type, regional);
                goodsPublishDto.setSecondCategoryId(secondCategoryId);
                goodsPublishDto.setFirstCategoryId(1l);

                List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto> goodsPublishImageDtosList = new ArrayList<>();
                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto goodsPublishImageDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto();
                //图片
                InfoImg infoImg = new InfoImg();
                infoImg.setInfoId(accountInfo.getId());
                infoImg.setType(Constants.STR_1);
                List<InfoImg> infoImgs = infoImgMapper.selectInfoImgList(infoImg);
                if (infoImgs.size() > 19) {
                    infoImgs = infoImgs.subList(0, 19);
                }
                if (CollectionUtils.isEmpty(infoImgs)) {
                    goodsPublishImageDto.setImageUrl("https://game.ikbh.top/logo/no_img.jpg");
                    goodsPublishImageDtosList.add(goodsPublishImageDto);
                } else {
                    for (InfoImg img : infoImgs) {
                        String imgUrl = img.getImgUrl();
                        if (!imgUrl.contains("https")) {
                            imgUrl = imgUrl.replace("http", "https");
                        }
                        boolean b = true;
                        try {
                            b = sensitiveScan(img.getImgUrl());
                        } catch (Exception e) {
                            throw new GlobalException("图片解析失败");
                        }
                        if (b) {
                            goodsPublishImageDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto();
                            goodsPublishImageDto.setImageUrl(imgUrl);
                            goodsPublishImageDtosList.add(goodsPublishImageDto);
                        }
                    }
                }
                goodsPublishDto.setImageUrlList(goodsPublishImageDtosList);


                AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsBaseInfoDto goodsBaseInfoDto = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsBaseInfoDto();

                StringBuffer title = new StringBuffer();
//                title.append("【" + accountInfo.getSuit() + "枪皮" + accountInfo.getGuns()+ "套装" + "】" + levle);

                SysDictData sysDictData = new SysDictData();
                sysDictData.setDictType("jym_hot_word");
                sysDictData.setStatus(Constants.STR_0);
                List<SysDictData> sysDictDataList = sysDictDataMapper.selectDictDataList(sysDictData);
                for (SysDictData dictData : sysDictDataList) {
                    if (des.contains(dictData.getDictLabel())) {
                        title.append(dictData.getDictLabel() + " ");
                    }
                }
                String title1 = "";
                if (StringUtils.isNotEmpty(title.toString()) && title.toString().length() > 15){
                    title1 = title.toString().substring(0, 15);
                }else {
                    title1 = title.toString();
                }
                goodsBaseInfoDto.setTitle(title1);
                if (accountInfo.getPrice().compareTo(new BigDecimal(100)) > 0) {
                    BigDecimal bigDecimal = commonApi.addPrice(accountInfo.getPrice(), sa.getSeleep());
                    commonApi.setPrice(bigDecimal,accountInfo.getId(),sa);
                    goodsBaseInfoDto.setPrice(bigDecimal.toPlainString());
                } else {
                    goodsBaseInfoDto.setPrice("119");
                }
                goodsBaseInfoDto.setStorage(1l);
                goodsBaseInfoDto.setDescription(des);

                goodsPublishDto.setGoodsBaseInfo(goodsBaseInfoDto);

                goodsPublishDto.setExternalGoodsId(accountInfo.getId() + getVersion());
                goodsPublishDto.setCanBargain(true);

                goodsPublishDtoList.add(goodsPublishDto);
                goodsPublishCommandDto.setGoodsList(goodsPublishDtoList);
            }

            AlibabaJymItemExternalGoodsBatchPublishResponse rsp = null;
            AlibabaJymItemExternalGoodsBatchPublishRequest req = new AlibabaJymItemExternalGoodsBatchPublishRequest();
            req.setGoodsPublishCommand(goodsPublishCommandDto);
            try {
                rsp = client.execute(req);
            } catch (ApiException e) {
                e.printStackTrace();
            }
            log.info("交易猫请求参数:{}", JSONObject.toJSONString(goodsPublishCommandDto));
            log.info("交易猫返回参数:{}", rsp.getBody());
            if (Objects.nonNull(rsp.getSucceed()) && rsp.getSucceed() != false) {
                AlibabaJymItemExternalGoodsBatchPublishResponse.GoodsBatchResultDto result = rsp.getResult();
                if (result != null) {
                    Long batchId = result.getBatchId();
                    if (batchId != null) {
                        AccountInfo info = accountInfoMapper.selectAccountInfoById(accountInfo.getId());
                        info.setJymBatchId(batchId);
                        info.setUpdateTime(new Date());
                        accountInfoMapper.updateAccountInfo(info);
                        HashMap<String, Object> res = new HashMap<>();
                        res.put("req", JSONObject.toJSONString(goodsPublishCommandDto));
                        res.put("res", rsp.getBody());
                        res.put("msg", rsp.getBody());
                        res.put("code", 200);
                        return res;
                    }
                }
            }
            if (accountInfo.getJymBatchId() == null) {
                log.error("交易猫发布商品失败:{}", rsp.getBody());
                HashMap<String, Object> res = new HashMap<>();
                res.put("req", JSONObject.toJSONString(goodsPublishCommandDto));
                res.put("res", rsp.getBody());
                res.put("msg", rsp.getBody());
                res.put("code", 500);
                return res;
            }

        }
        return AjaxResult.success();
    }

    private List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto> goodspropertyParams(AccountInfo accountInfo, List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto> list11, String regional) {
        AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto obj12 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
        //召唤师等级
        switch (regional) {
            case "安卓Q":
                obj12.setPropertyId(1642579782534118L);
                break;
            case "安卓WX":
                obj12.setPropertyId(1642579812111110L);
                break;
            case "苹果Q":
                obj12.setPropertyId(1642580017625086L);
                break;
            case "苹果WX":
                obj12.setPropertyId(1642581061804098L);
                break;
        }
        obj12.setValue("0");
        list11.add(obj12);

        //贵族等级
        obj12 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
        switch (regional) {
            case "安卓Q":
                obj12.setPropertyId(1642579782539128L);
                break;
            case "安卓WX":
                obj12.setPropertyId(1642579812119122L);
                break;
            case "苹果Q":
                obj12.setPropertyId(1642580017634100L);
                break;
            case "苹果WX":
                obj12.setPropertyId(1642581061811104L);
                break;
        }
        obj12.setValue("6");
        list11.add(obj12);

        //段位等级

        obj12 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
        switch (regional) {
            case "安卓Q":
                obj12.setPropertyId(1642579782572182L);
                break;
            case "安卓WX":
                obj12.setPropertyId(1642579812154190L);
                break;
            case "苹果Q":
                obj12.setPropertyId(1642580017638107L);
                break;
            case "苹果WX":
                obj12.setPropertyId(1642581061846148L);
                break;
        }
        obj12.setValue("无");
        list11.add(obj12);


        //荣耀水晶数量
        obj12 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
        switch (regional) {
            case "安卓Q":
                obj12.setPropertyId(1642579782601215L);
                break;
            case "安卓WX":
                obj12.setPropertyId(1642579812240043L);
                break;
            case "苹果Q":
                obj12.setPropertyId(1642580017692203L);
                break;
            case "苹果WX":
                obj12.setPropertyId(1642581061872184L);
                break;
        }
        obj12.setValue("0");
        list11.add(obj12);

        //英雄数量
        obj12 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
        switch (regional) {
            case "安卓Q":
                obj12.setPropertyId(1642579782657320L);
                break;
            case "安卓WX":
                obj12.setPropertyId(1642579812245052L);
                break;
            case "苹果Q":
                obj12.setPropertyId(1642580017750275L);
                break;
            case "苹果WX":
                obj12.setPropertyId(1642581062045431L);
                break;
        }
        obj12.setValue(accountInfo.getHeroes() != null ? accountInfo.getHeroes().toString() : "0");
        list11.add(obj12);


        //商家在线
        obj12 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
        switch (regional) {
            case "安卓Q":
                obj12.setPropertyId(1642579783158077L);
                break;
            case "安卓WX":
                obj12.setPropertyId(1644479768746098L);
                break;
            case "苹果Q":
                obj12.setPropertyId(1642580018375688L);
                break;
            case "苹果WX":
                obj12.setPropertyId(1642581062435475L);
                break;
        }
        obj12.setValue("全天在线");
//        list11.add(obj12);


        //帐号绑定
        obj12 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
        switch (regional) {
            case "安卓Q":
                obj12.setPropertyId(1642579783138057L);
                break;
            case "安卓WX":
                obj12.setPropertyId(1644479799783500L);
                break;
            case "苹果Q":
                obj12.setPropertyId(1642580018350660L);
                break;
            case "苹果WX":
                obj12.setPropertyId(1642581062421456L);
                break;
        }
        obj12.setValue("6");
        list11.add(obj12);


        //五级铭文个数
        obj12 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
        switch (regional) {
            case "安卓Q":
                obj12.setPropertyId(1642579783117031L);
                break;
            case "安卓WX":
                obj12.setPropertyId(1644479895836260L);
                break;
            case "苹果Q":
                obj12.setPropertyId(1642580018324633L);
                break;
            case "苹果WX":
                obj12.setPropertyId(1642581062396429L);
                break;
        }
        obj12.setValue("250");
        list11.add(obj12);

        //传说皮肤
        obj12 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
        List<String> wzrychuanshuoList = new ArrayList<>();
        switch (regional) {
            case "安卓Q":
                obj12.setPropertyId(1642579783039822L);
                boolean b = true;
                String wzrychuanshuo = JYMEmun.wzrychuanshuo;
                List<JSONObject> jsonObjects = JSONObject.parseArray(wzrychuanshuo, JSONObject.class);
                for (JSONObject jsonObject : jsonObjects) {
                    String value = jsonObject.getString("value");
                    if (StringUtils.isNotEmpty(value)) {
                        String[] split = value.split("-");
                        if (split.length > 1) {
                            if (accountInfo.getDes().contains(split[1])) {
//                                obj12 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
//                                obj12.setPropertyId(1642579783039822L);
                                b = false;
                                wzrychuanshuoList.add(value);
                            }
                        }
                    }
                }
                if (b) {
                    wzrychuanshuoList.add("无");
                }
                break;
            case "安卓WX":
                obj12.setPropertyId(1644479927099065L);
                b = true;
                wzrychuanshuo = JYMEmun.wzrywxchuanshuo;
                jsonObjects = JSONObject.parseArray(wzrychuanshuo, JSONObject.class);
                for (JSONObject jsonObject : jsonObjects) {
                    String value = jsonObject.getString("value");
                    if (StringUtils.isNotEmpty(value)) {
                        String[] split = value.split("-");
                        if (split.length > 1) {
                            if (accountInfo.getDes().contains(split[1])) {
//                                obj12 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
//                                obj12.setPropertyId(1642579783039822L);
                                b = false;
                                wzrychuanshuoList.add(value);
                            }
                        }
                    }
                }
                if (b) {
                    wzrychuanshuoList.add("无");
                }
                break;
            case "苹果Q":
                obj12.setPropertyId(1642580018247527L);
                b = true;
                wzrychuanshuo = JYMEmun.ioswzryqqchuanshuo;
                jsonObjects = JSONObject.parseArray(wzrychuanshuo, JSONObject.class);
                for (JSONObject jsonObject : jsonObjects) {
                    String value = jsonObject.getString("value");
                    if (StringUtils.isNotEmpty(value)) {
                        String[] split = value.split("-");
                        if (split.length > 1) {
                            if (accountInfo.getDes().contains(split[1])) {
//                                obj12 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
//                                obj12.setPropertyId(1642579783039822L);
                                b = false;
                                wzrychuanshuoList.add(value);
                            }
                        }
                    }
                }
                if (b) {
                    wzrychuanshuoList.add("无");
                }
                break;
            case "苹果WX":
                obj12.setPropertyId(1642581062325318L);
                b = true;
                wzrychuanshuo = JYMEmun.ioschuanshuowx;
                jsonObjects = JSONObject.parseArray(wzrychuanshuo, JSONObject.class);
                for (JSONObject jsonObject : jsonObjects) {
                    String value = jsonObject.getString("value");
                    if (StringUtils.isNotEmpty(value)) {
                        String[] split = value.split("-");
                        if (split.length > 1) {
                            if (accountInfo.getDes().contains(split[1])) {
//                                obj12 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
//                                obj12.setPropertyId(1642579783039822L);
                                b = false;
                                wzrychuanshuoList.add(value);
                            }
                        }
                    }
                }
                if (b) {
                    wzrychuanshuoList.add("无");
                }
                break;
        }
        String join = StringUtils.join(wzrychuanshuoList, ",");
        obj12.setValue(join);
        list11.add(obj12);
        wzrychuanshuoList.clear();

        List<String> wzryshishiList = new ArrayList<>();
        //史诗皮肤
        obj12 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
        switch (regional) {
            case "安卓Q":
                obj12.setPropertyId(1642579782845586L);
                String wzrychuanshuo = JYMEmun.wzryshishi;
                boolean b = true;
                List<JSONObject> jsonObjects = JSONObject.parseArray(wzrychuanshuo, JSONObject.class);
                for (JSONObject jsonObject : jsonObjects) {
                    String value = jsonObject.getString("value");
                    String id = jsonObject.getString("id");
                    if (StringUtils.isNotEmpty(value)) {
                        String[] split = value.split("-");
                        if (split.length > 1) {
                            if (accountInfo.getDes().contains(split[1])) {
                                b = false;
                                wzryshishiList.add(value);
                            }
                        }
                    }
                }
                if (b) {
                    wzryshishiList.add("无");
                }
                break;
            case "安卓WX":
                obj12.setPropertyId(1644479969287286L);
                wzrychuanshuo = JYMEmun.wzrywxshishi;
                b = true;
                jsonObjects = JSONObject.parseArray(wzrychuanshuo, JSONObject.class);
                for (JSONObject jsonObject : jsonObjects) {
                    String value = jsonObject.getString("value");
                    String id = jsonObject.getString("id");
                    if (StringUtils.isNotEmpty(value)) {
                        String[] split = value.split("-");
                        if (split.length > 1) {
                            if (accountInfo.getDes().contains(split[1])) {
                                b = false;
                                wzryshishiList.add(value);
                            }
                        }
                    }
                }
                if (b) {
                    wzryshishiList.add("无");
                }
                break;
            case "苹果Q":
                obj12.setPropertyId(1642580018047260L);
                wzrychuanshuo = JYMEmun.iosqqwzryshishi;
                b = true;
                jsonObjects = JSONObject.parseArray(wzrychuanshuo, JSONObject.class);
                for (JSONObject jsonObject : jsonObjects) {
                    String value = jsonObject.getString("value");
                    String id = jsonObject.getString("id");
                    if (StringUtils.isNotEmpty(value)) {
                        String[] split = value.split("-");
                        if (split.length > 1) {
                            if (accountInfo.getDes().contains(split[1])) {
                                b = false;
                                wzryshishiList.add(value);
                            }
                        }
                    }
                }
                if (b) {
                    wzryshishiList.add("无");
                }
                break;
            case "苹果WX":
                obj12.setPropertyId(1642581062129002L);
                wzrychuanshuo = JYMEmun.ioswxshishi;
                b = true;
                jsonObjects = JSONObject.parseArray(wzrychuanshuo, JSONObject.class);
                for (JSONObject jsonObject : jsonObjects) {
                    String value = jsonObject.getString("value");
                    String id = jsonObject.getString("id");
                    if (StringUtils.isNotEmpty(value)) {
                        String[] split = value.split("-");
                        if (split.length > 1) {
                            if (accountInfo.getDes().contains(split[1])) {
                                b = false;
                                wzryshishiList.add(value);
                            }
                        }
                    }
                }
                if (b) {
                    wzryshishiList.add("无");
                }
                break;
        }
        join = StringUtils.join(wzryshishiList, ",");
        obj12.setValue(join);
        list11.add(obj12);

        List<String> xiyouherosList = new ArrayList<>();
        //稀有英雄
        obj12 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
        switch (regional) {
            case "安卓Q":
                obj12.setPropertyId(1642579782767490L);
                String wzrychuanshuo = JYMEmun.xiyouheros;
                boolean b = true;
                List<JSONObject> jsonObjects = JSONObject.parseArray(wzrychuanshuo, JSONObject.class);
                for (JSONObject jsonObject : jsonObjects) {
                    String value = jsonObject.getString("value");
                    String id = jsonObject.getString("id");
                    if (StringUtils.isNotEmpty(value)) {
                        if (accountInfo.getDes().contains(value)) {
                            b = false;
                            xiyouherosList.add(value);
                        }
                    }
                }
                if (b) {
                    xiyouherosList.add("无");
                }
                break;
            case "安卓WX":
                obj12.setPropertyId(1644480138139220L);
                wzrychuanshuo = JYMEmun.wzryxiyouwx;
                b = true;
                jsonObjects = JSONObject.parseArray(wzrychuanshuo, JSONObject.class);
                for (JSONObject jsonObject : jsonObjects) {
                    String value = jsonObject.getString("value");
                    String id = jsonObject.getString("id");
                    if (StringUtils.isNotEmpty(value)) {
                        if (accountInfo.getDes().contains(value)) {
                            b = false;
                            xiyouherosList.add(value);
                        }
                    }
                }
                if (b) {
                    xiyouherosList.add("无");
                }
                break;
            case "苹果Q":
                obj12.setPropertyId(1642580017964154L);
                wzrychuanshuo = JYMEmun.wzryiosqqxiyouheros;
                b = true;
                jsonObjects = JSONObject.parseArray(wzrychuanshuo, JSONObject.class);
                for (JSONObject jsonObject : jsonObjects) {
                    String value = jsonObject.getString("value");
                    String id = jsonObject.getString("id");
                    if (StringUtils.isNotEmpty(value)) {
                        if (accountInfo.getDes().contains(value)) {
                            b = false;
                            xiyouherosList.add(value);
                        }
                    }
                }
                if (b) {
                    xiyouherosList.add("无");
                }
                break;
            case "苹果WX":
                obj12.setPropertyId(1642581062053439L);
                wzrychuanshuo = JYMEmun.iosxiyouheros;
                b = true;
                jsonObjects = JSONObject.parseArray(wzrychuanshuo, JSONObject.class);
                for (JSONObject jsonObject : jsonObjects) {
                    String value = jsonObject.getString("value");
                    String id = jsonObject.getString("id");
                    if (StringUtils.isNotEmpty(value)) {
                        if (accountInfo.getDes().contains(value)) {
                            b = false;
                            xiyouherosList.add(value);
                        }
                    }
                }
                if (b) {
                    xiyouherosList.add("无");
                }
                break;
        }
        join = StringUtils.join(xiyouherosList, ",");
        obj12.setValue(join);
        list11.add(obj12);

        List<String> waryxingyuanList = new ArrayList<>();
        //星元皮肤
        obj12 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
        switch (regional) {
            case "安卓Q":
                obj12.setPropertyId(1642579782822555L);
                String wzrychuanshuo = JYMEmun.waryxingyuan;
                boolean b = true;
                List<JSONObject> jsonObjects = JSONObject.parseArray(wzrychuanshuo, JSONObject.class);
                for (JSONObject jsonObject : jsonObjects) {
                    String value = jsonObject.getString("value");
                    if (StringUtils.isNotEmpty(value)) {
                        String[] split = value.split("-");
                        if (split.length > 1) {
                            if (accountInfo.getDes().contains(split[1])) {
                                b = false;
                                waryxingyuanList.add(value);
                            }
                        }
                    }
                }
                if (b) {
                    waryxingyuanList.add("无");
                }
                break;
            case "安卓WX":
                obj12.setPropertyId(1644480021004023L);
                wzrychuanshuo = JYMEmun.wzrywxxingyuan;
                b = true;
                jsonObjects = JSONObject.parseArray(wzrychuanshuo, JSONObject.class);
                for (JSONObject jsonObject : jsonObjects) {
                    String value = jsonObject.getString("value");
                    if (StringUtils.isNotEmpty(value)) {
                        String[] split = value.split("-");
                        if (split.length > 1) {
                            if (accountInfo.getDes().contains(split[1])) {
                                b = false;
                                waryxingyuanList.add(value);
                            }
                        }
                    }
                }
                if (b) {
                    waryxingyuanList.add("无");
                }
                break;
            case "苹果Q":
                obj12.setPropertyId(1642580018024229L);
                wzrychuanshuo = JYMEmun.iosxingyuanqq;
                b = true;
                jsonObjects = JSONObject.parseArray(wzrychuanshuo, JSONObject.class);
                for (JSONObject jsonObject : jsonObjects) {
                    String value = jsonObject.getString("value");
                    if (StringUtils.isNotEmpty(value)) {
                        String[] split = value.split("-");
                        if (split.length > 1) {
                            if (accountInfo.getDes().contains(split[1])) {
                                b = false;
                                waryxingyuanList.add(value);
                            }
                        }
                    }
                }
                if (b) {
                    waryxingyuanList.add("无");
                }
                break;
            case "苹果WX":
                obj12.setPropertyId(1642581062111527L);
                wzrychuanshuo = JYMEmun.ioswxxingyuan;
                b = true;
                jsonObjects = JSONObject.parseArray(wzrychuanshuo, JSONObject.class);
                for (JSONObject jsonObject : jsonObjects) {
                    String value = jsonObject.getString("value");
                    if (StringUtils.isNotEmpty(value)) {
                        String[] split = value.split("-");
                        if (split.length > 1) {
                            if (accountInfo.getDes().contains(split[1])) {
                                b = false;
                                waryxingyuanList.add(value);
                            }
                        }
                    }
                }
                if (b) {
                    waryxingyuanList.add("无");
                }
                break;
        }
        join = StringUtils.join(waryxingyuanList, ",");
        obj12.setValue(join);
        list11.add(obj12);

        List<String> wzrydiancangList = new ArrayList<>();
        //典藏皮肤
        obj12 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
        switch (regional) {
            case "安卓Q":
                obj12.setPropertyId(1642579782793518L);
                String wzrychuanshuo = JYMEmun.wzrydiancang;
                boolean b = true;
                List<JSONObject> jsonObjects = JSONObject.parseArray(wzrychuanshuo, JSONObject.class);
                for (JSONObject jsonObject : jsonObjects) {
                    String value = jsonObject.getString("value");
                    Long id = jsonObject.getLong("id");
                    if (StringUtils.isNotEmpty(value)) {
                        String[] split = value.split("-");
                        if (split.length > 1) {
                            if (accountInfo.getDes().contains(split[1])) {
                                b = false;
                                wzrydiancangList.add(value);
                            }
                        }
                    }
                }
                if (b) {
                    wzrydiancangList.add("无");
                }
                break;
            case "安卓WX":
                obj12.setPropertyId(1644480089843039L);
                wzrychuanshuo = JYMEmun.wzrydiancangwx;
                b = true;
                jsonObjects = JSONObject.parseArray(wzrychuanshuo, JSONObject.class);
                for (JSONObject jsonObject : jsonObjects) {
                    String value = jsonObject.getString("value");
                    Long id = jsonObject.getLong("id");
                    if (StringUtils.isNotEmpty(value)) {
                        String[] split = value.split("-");
                        if (split.length > 1) {
                            if (accountInfo.getDes().contains(split[1])) {
                                b = false;
                                wzrydiancangList.add(value);
                            }
                        }
                    }
                }
                if (b) {
                    wzrydiancangList.add("无");
                }
                break;
            case "苹果Q":
                obj12.setPropertyId(1642580017990187L);
                wzrychuanshuo = JYMEmun.iosqqdiancang;
                b = true;
                jsonObjects = JSONObject.parseArray(wzrychuanshuo, JSONObject.class);
                for (JSONObject jsonObject : jsonObjects) {
                    String value = jsonObject.getString("value");
                    Long id = jsonObject.getLong("id");
                    if (StringUtils.isNotEmpty(value)) {
                        String[] split = value.split("-");
                        if (split.length > 1) {
                            if (accountInfo.getDes().contains(split[1])) {
                                b = false;
                                wzrydiancangList.add(value);
                            }
                        }
                    }
                }
                if (b) {
                    wzrydiancangList.add("无");
                }
                break;
            case "苹果WX":
                obj12.setPropertyId(1642581062079475L);
                wzrychuanshuo = JYMEmun.ioswxxianding;
                b = true;
                jsonObjects = JSONObject.parseArray(wzrychuanshuo, JSONObject.class);
                for (JSONObject jsonObject : jsonObjects) {
                    String value = jsonObject.getString("value");
                    Long id = jsonObject.getLong("id");
                    if (StringUtils.isNotEmpty(value)) {
                        String[] split = value.split("-");
                        if (split.length > 1) {
                            if (accountInfo.getDes().contains(split[1])) {
                                b = false;
                                wzrydiancangList.add(value);
                            }
                        }
                    }
                }
                if (b) {
                    wzrydiancangList.add("无");
                }
                break;
        }
        join = StringUtils.join(wzrydiancangList, ",");
        obj12.setValue(join);
        list11.add(obj12);


        //皮肤数量
        obj12 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
        switch (regional) {
            case "安卓Q":
                obj12.setPropertyId(1642579782765488L);
                break;
            case "安卓WX":
                obj12.setPropertyId(1644480165417006L);
                break;
            case "苹果Q":
                obj12.setPropertyId(1642580017959146L);
                break;
            case "苹果WX":
                obj12.setPropertyId(1642581062050436L);
                break;
        }
        obj12.setValue(accountInfo.getSkins() != null ? accountInfo.getSkins().toString() : "0");
        list11.add(obj12);
        return list11;
    }

    private Long getGoodsId(Long batchId) {
        TaobaoClient client = new DefaultTaobaoClient(OutUrlConstant.JYMURL, "33897201", "d38aa77a37144a1ed04deb36ed0d0f66");

        AlibabaJymItemExternalGoodsBatchtaskQueryRequest req = new AlibabaJymItemExternalGoodsBatchtaskQueryRequest();
        AlibabaJymItemExternalGoodsBatchtaskQueryRequest.GoodsBatchTaskQueryDto obj1 = new AlibabaJymItemExternalGoodsBatchtaskQueryRequest.GoodsBatchTaskQueryDto();
        obj1.setBatchId(batchId);
        req.setGoodsBatchTaskQuery(obj1);
        AlibabaJymItemExternalGoodsBatchtaskQueryResponse rsp = null;
        log.info("查询交易猫goodsid返回:{}", JSON.toJSONString(req));
        try {
            rsp = client.execute(req);
        } catch (ApiException e) {
            e.printStackTrace();
        }
        log.info("查询交易猫goodsid返回:{}", rsp.getBody());
        if (Objects.nonNull(rsp.getSucceed()) && rsp.getSucceed() != false) {
            AlibabaJymItemExternalGoodsBatchtaskQueryResponse.GoodsBatchTaskResultDto result = rsp.getResult();
            if (result != null) {
                Long status = result.getStatus();
                if (status.intValue() == 3 || status.intValue() == 2) {
                    List<AlibabaJymItemExternalGoodsBatchtaskQueryResponse.GoodsBatchSubTask> goodsBatchSubTaskList = result.getGoodsBatchSubTaskList();
                    for (AlibabaJymItemExternalGoodsBatchtaskQueryResponse.GoodsBatchSubTask goodsBatchSubTask : goodsBatchSubTaskList) {
                        Long goodsId = goodsBatchSubTask.getGoodsId();
                        if (goodsId != null) {
                            return goodsId;
                        }
                    }
                }
            }
        }
        log.error("查询交易猫goodsid失败！！！:{}", rsp.getBody());
        return null;
    }

    private boolean sensitiveScan(String path) {

//        SysDictData sysDictData = new SysDictData();
//        sysDictData.setDictType("aly_access");
//        sysDictData.setStatus(Constants.STR_0);
//        List<SysDictData> sysDictDataList = sysDictDataMapper.selectDictDataList(sysDictData);
//        String accessKeyId = "";
//        String accessKeySecret = "";
//        if (!CollectionUtils.isEmpty(sysDictDataList)) {
//            for (SysDictData dictData : sysDictDataList) {
//                if (Objects.equals(dictData.getDictLabel(), "accessKeyId")) {
//                    accessKeyId = dictData.getDictValue();
//                }
//                if (Objects.equals(dictData.getDictLabel(), "accessKeySecret")) {
//                    accessKeySecret = dictData.getDictValue();
//                }
//            }
//        }
//        try {
//            String result = Sample.parseText(accessKeyId, accessKeySecret, path);
//            result = desRepalce(result);
//            sysDictData = new SysDictData();
//            sysDictData.setDictType("jym_check");
//            sysDictData.setStatus(Constants.STR_0);
//            sysDictDataList = sysDictDataMapper.selectDictDataList(sysDictData);
//            for (SysDictData dictData : sysDictDataList) {
//                if (result.contains(dictData.getDictValue())) {
//                    return false;
//                }
//            }
//            if (getYindi(result)) {
//                return true;
//            } else {
//                return false;
//            }
//        } catch (Exception e) {
//            e.printStackTrace();
//            return false;
//        }
        return true;
    }

    private boolean getYindi(String des) {

        String str2 = "";
        if (StringUtils.isNotEmpty(des)) {
            for (int i = 0; i < des.length(); i++) {
                if (des.charAt(i) >= 48 && des.charAt(i) <= 57) {
                    str2 += des.charAt(i);
                } else {
                    if (str2.length() > 6) {
                        des = des.replace(str2, "");
                        return false;
                    }
                    str2 = "";
                }
            }
        }
        return true;
    }

    private String guolv(String des) {
        SysDictData sysDictData = new SysDictData();
        sysDictData.setDictType("jym_check");
        sysDictData.setStatus(Constants.STR_0);
        List<SysDictData> sysDictDataList = sysDictDataMapper.selectDictDataList(sysDictData);
        for (SysDictData dictData : sysDictDataList) {
            String value = dictData.getDictValue();
            if (des.contains(value)) {
                des = des.replace(value, "");
            }
        }
        return des;
    }

    private String desRepalce(String des) {
        if (StringUtils.isNotEmpty(des)) {
            des = des.replace("包人脸", "").replace("营地号", "")
                    .replace("有二次", "可二次")
                    .replace("人脸", "")
                    .replace("实名", "")
                    .replace("未成年人", "")
                    .replace("暑假", "")
                    .replace("高中", "")
                    .replace("防沉迷", "")
                    .replace("身份证", "")
                    .replace("实名信息", "")
                    .replace("身份证号码", "")
                    .replace("实名", "")
                    .replace("人脸验证", "")
                    .replace("未成年词", "")
                    .replace("小学", "")
                    .replace("初中", "")
                    .replace("高中", "")
                    .replace("营地ID", "")
                    .replace("Q号", "")
                    .replace("Q", "扣")
                    .replace("WX", "V")
                    .replace("QQ号", "")
                    .replace("手机号", "")
                    .replace("微信号", "V")
                    .replace("初中", "")
                    .replace("到删", "")
                    .replace("到删除", "")
                    .replace("到除", "")
                    .replace("营", "")
                    .replace("地", "")
                    .replace("ID", "")
                    .replace("】", "")
                    .replace("【", "")
                    .replace("|", "")
                    .replace("小学", "");
        }
        return des;
    }

    private String getVersion() {
        List<SysDictData> sysDictDataList = sysDictDataMapper.selectDictDataByType("JYMVERSION");
        if (CollectionUtils.isNotEmpty(sysDictDataList)) {
            return sysDictDataList.get(0).getDictValue();
        }
        return "";
    }

    public void setJymTask(AccountInfo accountInfo, Long taskId, String type){
        Jymtask jymtask = new Jymtask();
        jymtask.setAccountid(accountInfo.getId());
        jymtask.setCreateId(accountInfo.getCreateId());
        jymtask.setCreateTime(new Date());
        if (Objects.equals(LCConstant.interAdd,type)){
            jymtask.setAddStatus("0");
            jymtask.setJymAddTaskId(taskId);
        }
        if (Objects.equals(LCConstant.interEdit,type)){
            jymtask.setEditStatus("0");
            jymtask.setJymEditTaskId(taskId);
        }
        if (Objects.equals(LCConstant.interDel,type)){
            jymtask.setDelStatus("0");
            jymtask.setJymDelTaskId(taskId);
        }
        jymtaskMapper.insertJymtask(jymtask);
    };


    public static void main(String[] args) {

        String pattern = "[1-9]([0-9]{1,8})";
        String des = "sdfasdfasdfsdafsdaf545580271sdfasdfasdf";
        des = Pattern.compile(pattern).matcher(des).replaceAll("");
        System.out.println(des);
//        try {
////            sensitiveScan("http://game.ikbh.top/2c92808281d417aa0181ec78bcd5077e");
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//
//        TaobaoClient client = new DefaultTaobaoClient(OutUrlConstant.JYMURL, "34261423", "a62591208fb20be3a9ce3b2abe50877e");
//
//        AlibabaJymItemExternalGoodsBatchtaskQueryRequest req = new AlibabaJymItemExternalGoodsBatchtaskQueryRequest();
//        AlibabaJymItemExternalGoodsBatchtaskQueryRequest.GoodsBatchTaskQueryDto obj1 = new AlibabaJymItemExternalGoodsBatchtaskQueryRequest.GoodsBatchTaskQueryDto();
//        obj1.setBatchId(7041427371815188489l);
//        req.setGoodsBatchTaskQuery(obj1);
//        AlibabaJymItemExternalGoodsBatchtaskQueryResponse rsp = null;
//        try {
//            rsp = client.execute(req);
//        } catch (ApiException e) {
//            e.printStackTrace();
//        }
//        System.out.println(rsp.getBody());
    }
}


//6948547291351474187
//6948553571512215554
//6950335972848555530
//